BIN=myproc.exe
CC=gcc
SRC=$(wildcard *.c)

RM=rm -f
FLASG=-c
LFLASG=-o
OBJ=$(SRC:.c=.o)

$(BIN):$(OBJ)
	@	$(CC) $(LFLASG) $(@) $(^) 
	@echo "Linking ... $^ to $@"
%.o:%.c
	@	$(CC) $(FLASG) $<
	@echo "compling ... $< to $@"

.PHONY:clean 
clean:
		$(RM) $(BIN) $(OBJ)
.PHONY:test
test:
		@echo $(SRC)
		@echo $(OBJ)
#code:code.o
#		gcc  code.o -o code
#code.o:code.s
#		gcc -c code.s -o code.o
#code.s:code.i
#		gcc -S code.i -o code.s
#code.i:code.c
#		gcc -E code.c -o code.i

#.PHONY:clean
#clean:
#		rm -f code.o code.i code.s code
